package com.itheima.common;

public class BaseContext {
    //定义一个ThreadLocal
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //获取自己线程存储的值
    public static Long getCurrentId(){
        return threadLocal.get();
    }

    //设置值 - 参数为你要存入空间的值
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
}
